<%@ page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<%@ include file="/app/include.jsp"%>
		<script type="text/javascript">
			// 添加功效信息
			function add(){
				var fromUrl = "${pageContext.request.contextPath}/app/data/insert-one-effect.jsp";
				var toUrl = "${pageContext.request.contextPath}/datamanage/addOneEffect.do";
				var title = "添加功效信息";
				Tool.showSaveDialog(fromUrl,toUrl,title,600,200);
			}
			
			// 修改功效信息
			function edit(id){
				var fromUrl = "${pageContext.request.contextPath}/datamanage/selectOneEffect.do?id=" + id;
				var toUrl = "${pageContext.request.contextPath}/datamanage/editOneEffect.do";
				var title = "修改功效信息";
				Tool.showUpdateDialog(fromUrl,toUrl,title,600,200);
			}
			
			// 删除功效信息
			function del(id){
				var url = "${pageContext.request.contextPath}/datamanage/delOneEffect.do";
				var params = {
					"id" : id
				};
				Tool.del(url,params);
			}
		</script>
	</head>
	<body>
		<div class="right_content">
			<ul class="breadcrumb">
				<li>
					数据管理
					<span>/</span>
				</li>
				<li class="active">
					功效管理
				</li>
			</ul>
			<div class="list-wrap">
				<form id="queryForm" name="queryForm" action="${pageContext.request.contextPath}/datamanage/loadEffectList.do">
					<div class="pull">
						<div class="pull-left">
							功效名称&nbsp;<input id="effectname" name="effectname" type="text" style="width: 240px;" value="${effectname}"/>
 						</div>
						<div class="pull-right">
							<input type="button" class="btn btn-primary" value="查询" onclick="Page.queryPage();"/>
							<input type="button" class="btn btn-primary" value="重置" onclick="Page.clearForm();"/>
							<input type="button" class="btn btn-primary" value="新增功效" onclick="add();"/>
						</div>
					</div>
				</form>
				<div class="table-wrap">
					<table border="0" cellpadding="0" cellspacing="0" class="list">
						<thead>
							<tr>
								<th width="5%">序号</th>
								<th>功效名称</th>
								<th width="15%">类别</th> 
								<th width="15%">操作时间</th> 
								<th width="15%">操作人</th>   
								<th width="20%">操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="result" items="${page.list}" varStatus="status">
							<tr>
								<td align="center">${page.pageSize * (page.pageNo - 1) + status.index + 1 }</td>
								<td><a href="javascript:void(0);" onclick="edit('${result.id }');">${result.effectname}</a></td>
								<td><open:out valueset="[功效类别]" value="${result.type}" /></td> 
								<td>${result.opertime}</td>
								<td>${result.username}</td> 
								<td align="center">
									<a href="javascript:void(0);" onclick="edit('${result.id }');">修改</a>&nbsp;&nbsp;
									<a href="javascript:void(0);" onclick="del('${result.id }');">删除</a>
								</td>
							</tr>
							</c:forEach>
							<c:if test="${fn:length(page.list) == 0}">
								<tr>
									<td colspan=6 align="center"><font color=red><strong>没有可用的功效信息！</strong></font></td>
								</tr>
							</c:if>
						</tbody>
					</table>
				</div>

				<!--分页开始-->
				${page.operate }
				<!--/分页结束-->
			</div>
		</div>
	</body>
</html>